README: fix API drift in resource-locator and function-registration examples - #1331
Open
ZayanKhan-12 wants to merge 4 commits into
Open
README: fix API drift in resource-locator and function-registration examples#1331ZayanKhan-12 wants to merge 4 commits into
ZayanKhan-12 wants to merge 4 commits into
Conversation
There is no ResourceLoader type in jinjava; the interface to implement is com.hubspot.jinjava.loader.ResourceLocator (as the rest of the section already says). Co-Authored-By: Claude Fable 5 <[email protected]>
The file-system locator class is com.hubspot.jinjava.loader.FileLocator; no FileResourceLocator exists. Co-Authored-By: Claude Fable 5 <[email protected]>
Jinjava.setResourceLocator takes a single ResourceLocator; the example passed two. Wrap them in CascadingResourceLocator (varargs constructor), which is what the surrounding text describes, and use the real FileLocator class name. Co-Authored-By: Claude Fable 5 <[email protected]>
The call opens two parens (registerFunction( and new ELFunctionDefinition() but closed only one. Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four fixes to README examples that don't match the current API, one commit each:
ResourceLoader→ResourceLocator— noResourceLoadertype exists in jinjava; the interface to implement iscom.hubspot.jinjava.loader.ResourceLocator(the rest of the section already uses the correct name).FileResourceLocator→FileLocator— the file-system locator class iscom.hubspot.jinjava.loader.FileLocator;FileResourceLocatordoesn't exist anywhere in the tree.Jinjava.setResourceLocator(ResourceLocator)takes a single argument (Jinjava.java), but the example passed two. Now wraps them inCascadingResourceLocator(varargs constructor), which is exactly what the surrounding text describes.registerFunction(new ELFunctionDefinition(...)example — two opening parens, one close.Verification: every class/method name checked against
src/main/java; fullmvn testsuite run locally on macOS arm64 with the JDK 21 toolchain: 2201 tests, 0 failures, 0 errors (23 skipped), BUILD SUCCESS.Prepared with AI assistance (Claude); all claims verified against the source as described.